define(function(require, exports, module) {

  // var Backbone = require('backbone');
  var $ = require('jquery');
  var _ = require('underscore');
  // var jsonview = require('jsonview');
  var tmpl = require('text!../tmpl.html');

  function main() {
    var $app = $('<div id="app">');
    $('#main').html($app);

    $app.append(tmpl);

    var $el = $('<canvas width="800" height="600">')
    $('#canvas1').append($el)

    var ctx = $el[0].getContext('2d')

    var gradient = linerGradient(ctx)

    ctx.arc(100, 120, 100, 3 * Math.PI / 2, Math.PI * 2);
    ctx.strokeStyle = gradient;
    ctx.lineWidth = 20
    ctx.stroke()
  }

  function linerGradient(ctx) {
    var gradient = ctx.createLinearGradient(100, 20, 200, 120);

    gradient.addColorStop(0, 'blue')
    gradient.addColorStop(1, 'red')

    return gradient
  }

  return main;
})
